<%--
  Created by IntelliJ IDEA.
  User: ZhuChunXiao
  Date: 2017/5/25
  Time: 15:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<div id="page-content">
  <div class="row">

    <div class="col-lg-12">
      <div class="panel">
        <div class="panel-heading">
          <h3 class="panel-title">提醒事项</h3>
        </div>
        <div class="panel-body">
          <div class="table-jqgrid">
            <table id="ajax_remind_table" >
            </table>
            <div id="ajax_remind_list_page">
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</div>



<script type="text/javascript">


  $(function(){
    jQuery("#ajax_remind_table").jqGrid({
      url:'<%=path%>/main/remind/list',
        datatype: "json",
        colNames:['提醒内容','创建时间','url',"id"],
        colModel:[
            {name:'content',index:'content', width:200,search:false,sortable:false},
            {name:'time',index:'time', width:100,search:false,sortable:false},
            {name:'url',index:'url', width:0,search:false,sortable:false,hidden:true},
            {name:'id',index:'id',search:false,hidden:true,key:true}
        ],
        rowNum : 10,
        rowList:[10,20,30],
        pager : '#ajax_remind_list_page',
        sortname : '',
        sortorder : "",
        gridComplete:function(){
           // $(".ui-jqgrid-bdiv").css("overflow-x","hidden");

        },
        onSelectRow: function (rowId, status, e) {
            var rowId = $("#ajax_remind_table").jqGrid('getGridParam','selrow');
            var rowDatas = $("#ajax_remind_table").jqGrid('getRowData', rowId);
        },
        ondblClickRow:function(rowid, iRow, iCol, e){
            var rowId = $("#ajax_remind_table").jqGrid('getGridParam','selrow');
            var rowDatas = $("#ajax_remind_table").jqGrid('getRowData', rowId);
            if(rowId !="")
            loadURL(rowDatas.url,$('#page-content'));
        },
        jsonReader: {
            root: "dataRows",
            page: "page",
            total: "total",
            records: "records",
            repeatitems : false
        },
      //  caption : "提醒事项",
        multiselect : false,
        rownumbers:false,
        gridview:true,
        shrinkToFit:true,
        viewrecords: false,
        autowidth: true,
        height:'auto',
        forceFit:true,
        loadComplete: function() {
        }
    });
    $(window).on('resize.jqGrid', function() {
     // jQuery("#ajax_process_table").jqGrid('setGridWidth', $("#ajax_process_list_row").width());
    });
    jQuery("#ajax_remind_table").jqGrid('filterToolbar',{searchOperators:false,stringResult:true});
    jQuery("#ajax_remind_table").jqGrid('navGrid', "#ajax_remind__list_page", {
      edit : false,
      add : false,
      del : false,
      search:false
    });

  });



</script>


